//
//  AlertControllerShared.m
//  CPU_Utility
//
//  Created by leonardo on 15/10/13.
//  Copyright © 2015年 leonardo. All rights reserved.
//

#import "AlertControllerShared.h"
#import <AFNetworking.h>
#import <UIKit/UIKit.h>
@implementation AlertControllerShared
//废除初始化方法
- (instancetype)init
{
    @throw [NSException exceptionWithName:@"Utility" reason:@"Can't init in Sington " userInfo:nil];
}
//
- (instancetype)initPrivate
{
    self = [super init];
    if (self) {
      //@  AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
        // manager.
    }
    return self;
}


+(AlertControllerShared*) defaultAlert{
    static AlertControllerShared * util = nil;
    
    static dispatch_once_t token;
    
    dispatch_once(&token, ^{
        if (!util) {
            util = [[self alloc] initPrivate];
        }
    });
    return util;
    
    
}
/**
 *  通知框
 *
 *  @param msg 信息
 *  @param vc  视图控制器
 */
-(void)showAlert:(NSString *) msg withVC:(UIViewController*)vc{
    UIAlertController * ac = [UIAlertController alertControllerWithTitle:@"注意" message:msg preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction * action = [UIAlertAction actionWithTitle:@"是" style:UIAlertActionStyleDefault handler:nil];
    [ac addAction:action];
    
    [vc presentViewController:ac animated:YES completion:nil];
}

@end
